//
//  SAUserInfo.m
//  yidiantong
//
//  Created by 黄志刚 on 2020/10/10.
//

#import "SAUserInfo.h"

@implementation SAUserInfo

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_empName forKey:@"empName"];
    [aCoder encodeObject:_mobile forKey:@"mobile"];
    [aCoder encodeObject:_storeName forKey:@"storeName"];
    [aCoder encodeObject:_token forKey:@"token"];
    [aCoder encodeObject:_userName forKey:@"userName"];
    [aCoder encodeInteger:_defaultPriceType forKey:@"defaultPriceType"];
    [aCoder encodeInteger:_merchantId forKey:@"merchantId"];
    [aCoder encodeInteger:_userType forKey:@"userType"];
    [aCoder encodeObject:_password forKey:@"password"];
    [aCoder encodeBool:_rememberPassword forKey:@"rememberPassword"];
    [aCoder encodeObject:_storeInfo forKey:@"storeInfo"];
    [aCoder encodeObject:_isVip forKey:@"isVip"];
    [aCoder encodeObject:_isMarketingOpen forKey:@"isMarketingOpen"];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _empName = [aDecoder decodeObjectForKey:@"empName"];
        _mobile = [aDecoder decodeObjectForKey:@"mobile"];
        _storeName = [aDecoder decodeObjectForKey:@"storeName"];
        _token = [aDecoder decodeObjectForKey:@"token"];
        _userName = [aDecoder decodeObjectForKey:@"userName"];
        _defaultPriceType = [aDecoder decodeIntegerForKey:@"defaultPriceType"];
        _merchantId = [aDecoder decodeIntegerForKey:@"merchantId"];
        _userType = [aDecoder decodeIntegerForKey:@"userType"];
        _password = [aDecoder decodeObjectForKey:@"password"];
        _rememberPassword = [aDecoder decodeBoolForKey:@"rememberPassword"];
        _storeInfo = [aDecoder decodeObjectForKey:@"storeInfo"];
        _isVip = [aDecoder decodeObjectForKey:@"isVip"];
        _isMarketingOpen = [aDecoder decodeObjectForKey:@"isMarketingOpen"];
    }
    return self;
}

@end

@implementation StoreInfoDic

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_storeName forKey:@"storeName"];
    [aCoder encodeObject:_warnDesc forKey:@"warnDesc"];
    [aCoder encodeObject:_remarks forKey:@"remarks"];
    [aCoder encodeObject:_logoPic forKey:@"logoPic"];
    [aCoder encodeObject:_contactPhone forKey:@"contactPhone"];
    [aCoder encodeObject:_address forKey:@"address"];
    [aCoder encodeInteger:_storeId forKey:@"storeId"];
    [aCoder encodeInteger:_storeType forKey:@"storeType"];
    [aCoder encodeInteger:_defaultPriceType forKey:@"defaultPriceType"];
    [aCoder encodeObject:_cardForm forKey:@"cardForm"];

}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _storeName = [aDecoder decodeObjectForKey:@"storeName"];
        _warnDesc = [aDecoder decodeObjectForKey:@"warnDesc"];
        _remarks = [aDecoder decodeObjectForKey:@"remarks"];
        _logoPic = [aDecoder decodeObjectForKey:@"logoPic"];
        _contactPhone = [aDecoder decodeObjectForKey:@"contactPhone"];
        _address = [aDecoder decodeObjectForKey:@"address"];
        _storeId = [aDecoder decodeIntegerForKey:@"storeId"];
        _storeType = [aDecoder decodeIntegerForKey:@"storeType"];
        _defaultPriceType = [aDecoder decodeIntegerForKey:@"defaultPriceType"];
        _cardForm = [aDecoder decodeObjectForKey:@"cardForm"];
    }
    return self;
}

@end

@implementation CardFormDic

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_bankCardNo forKey:@"bankCardNo"];
    [aCoder encodeObject:_bankName forKey:@"bankName"];
    [aCoder encodeObject:_holder forKey:@"holder"];
    [aCoder encodeInteger:_storeCardId forKey:@"storeCardId"];

}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _bankCardNo = [aDecoder decodeObjectForKey:@"bankCardNo"];
        _bankName = [aDecoder decodeObjectForKey:@"bankName"];
        _holder = [aDecoder decodeObjectForKey:@"holder"];
        _storeCardId = [aDecoder decodeIntegerForKey:@"storeCardId"];
    }
    return self;
}

@end
